﻿using System;

namespace InfiniTec.Threading
{
	public sealed class WaitAction: OperationAction
	{
		private readonly DateTime _Date;

		public DateTime Date
		{
			get { return _Date; }
		}

		public WaitAction(TimeSpan timeout)
		{
			if (timeout < TimeSpan.Zero) throw new ArgumentOutOfRangeException("timeout", timeout, "The specified timespan must be greater than zero");

			_Date = DateTime.Now + timeout;
		}

		public WaitAction(DateTime waitUntil)
		{
			_Date = waitUntil;
		}
	}
}
